<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.news.util.Pager"%>
<%@page import="com.news.bean.NewsType"%>
<%@page import="com.news.bean.News"%>

<LINK href="images/admin_css.css" type=text/css rel=stylesheet>
<script>
function selectAll(obj)
{
for(var i = 0;i<obj.elements.length;i++)
if(obj.elements[i].type == "checkbox")
obj.elements[i].checked = true;
}
function selectOther(obj)
{
for(var i = 0;i<obj.elements.length;i++)
if(obj.elements[i].type == "checkbox" )
{
if(!obj.elements[i].checked)
obj.elements[i].checked = true;
else
obj.elements[i].checked = false;

}
}
</script>

<script language="javascript">
function changecolor(obj)
{
   e = event.srcElement
   if(e.checked==true)
   {
     e = e.parentElement
     e = e.parentElement
     e.style.background = "#C1D2EE"
    }
    else
    {
      e = e.parentElement
      e = e.parentElement
      e.style.background = "#ffffff"
     }
} 

</script>
<table width="98%" border="0" align="center" cellpadding="0"
	cellspacing="1" bgcolor="#D2E8F6">
	<tr bgcolor="#f0f0f0">
		<td width="700" height="25" bgcolor="#D2E8F6">
			&nbsp;&nbsp;[ 本站新闻 ]信息列表
		</td>
	</tr>
	<tr align="center" bgcolor="#FFFFFF">
		<td height="35" align="left" valign="top">
			<form action="news?cmd=del" method="post"
				name="form1">
				<table width="100%" border="0" cellpadding="0" cellspacing="1"
					bgcolor="#F2F9FD">
					<tr align="center" bgcolor="#F2F9FD">
						<td width="36" height="25">选择
						</td>
						<td width="449" bgcolor="#F2F9FD">标题
						</td>
						<td width="100">是否显示
						</td>
						<td width="100">修改
						</td>
						<td width="100">操作
						</td>
					</tr>
					<%
					List<News> list = (List<News>)request.getAttribute("list");
					if(list!=null&&list.size()>0){
						for(News news:list){
					 %>
					<tr onMouseOver="this.bgColor='#F2F9FD';"
						onmouseout="this.bgColor='#FFFFFF';" bgColor=#ffffff>
						<td width="36" height="25" align="center">
							<input name="id" type="checkbox" id="id" value="<%=news.getId()%>"
								onclick="javascript:changecolor(this.name);">
						</td>
						<td>
							<a href="news?cmd=loadedit&id=<%=news.getId()%>"><%=news.getTitle() %></a>
						</td>
						<td align="center">
							<%if(news.getShows().equals("1")){ %>已显示<%}else{ %>未显示<%} %> &nbsp;
						</td>
						<td align="center">
							<a href="news?cmd=loadedit&id=<%=news.getId()%>">修改</a>
						</td>
						<td align="center">
							<a href="news?cmd=del&id=<%=news.getId() %>"
								onclick="return confirm('您确定要删除吗？');">删除</a>
						</td>
					</tr>
					<%}
					} %>
	

					<tr bgcolor="#FFFFFF">
						<td height="30" colspan="5">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td align="left">
										&nbsp;&nbsp;
										<input type=button class="button"
											onclick=selectAll(document.form1) value="全选">
										<input type=button class="button"
											onclick=selectOther(document.form1) value="反选">
										<input type=reset class="button" value="全部取消">
										<input name="Submit" type="button" class="button"
											onclick="history.go(-1);" value=" 返 回 ">
									</td>
									<td align="right">
										<input name="Submit" type="submit" class="button"
											value="删除选中的信息"
											onclick="return confirm('您确定要删除吗？删除后将无法恢复，请谨慎操作！');">
										&nbsp;&nbsp;
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				
			</form>
